package com.example.demo.app;

import com.example.demo.bean.Menus;
import com.example.demo.tools.ExcelUtils;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class AppUtils implements ApplicationContextAware {
    public static List<Menus> menusList = new ArrayList<Menus>();

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        //服务启动时加载excel数据
        ExcelUtils.readExcelContent();
    }
}
